module.exports = app => {
    const { STRING, INTEGER, DATE, BIGINT, TINYINT, DECIMAL } = app.Sequelize;

    const Order = app.model.define('order', {
        order_id: {
            type: BIGINT.UNSIGNED,
            primaryKey: true,
            autoIncrement: true,
        },
        buyer_id: { type: BIGINT.UNSIGNED, allowNull: false },
        seller_id: { type: BIGINT.UNSIGNED, allowNull: false },
        goods_id: { type: BIGINT.UNSIGNED, allowNull: false },
        amount: { type: DECIMAL(10, 2), allowNull: false },
        status: { type: TINYINT, allowNull: false, defaultValue: 1 },
        created_at: DATE,
        updated_at: DATE,
    }, {
        tableName: 'orders',
        timestamps: false,
    });

    return Order;
};